<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%--
  Created by IntelliJ IDEA.
  User: 16704
  Date: 2019/6/26
  Time: 上午 12:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>房间信息-宿管系统</title>
    <link rel="stylesheet" href="../../css/basicLayout.css">
</head>
<body>

<!--    头部，用来放导航栏-->
<div id="header">
    <ul>
        <li><a href="${pageContext.request.contextPath}/student/index"> 学生管理</a></li>
        <li><a href="${pageContext.request.contextPath}/class/index"> 班级管理</a></li>
        <li><a href="${pageContext.request.contextPath}/room/index"> 房间管理</a></li>
    </ul>
</div>

<!--子导航栏区域-->
<div id="child">
    <label>房间管理功能</label>
    <ul>
        <li><a href="${pageContext.request.contextPath}/room/add/index">添加房间</a></li>
    </ul>
</div>

<!--主体内容区域-->
<div id="content">
    <table>
        <tr>
            <td>房间地址：</td>
            <td>${room.roomAddress}</td>
        </tr>

        <tr>
            <td>房间户型：</td>
            <td>${room.buildingType}</td>
        </tr>

        <tr>
            <td>可容纳人数：</td>
            <td>${room.capNum}</td>
        </tr>

        <tr>
            <td>房间类型：</td>
            <c:if test="${room.roomType=='F'}">
                <td>男生寝室</td>
            </c:if>
            <c:if test="${room.roomType=='M'}">
                <td>女生寝室</td>
            </c:if>
        </tr>

        <tr>
            <td>房租：</td>
            <td>${room.rentPrice}</td>
        </tr>

        <tr>
            <td>支付方式：</td>
            <td>${room.payType}</td>
        </tr>

        <tr>
            <td>房东：</td>
            <td>${room.roomHost}</td>
        </tr>

        <tr>
            <td>房东电话：</td>
            <td>${room.hostTel}</td>
        </tr>
        <tr>
            <td>房间状态：</td>
            <c:if test="${room.roomStatus=='Y'}">
                <td>正常</td>
            </c:if>
            <c:if test="${room.roomStatus=='N'}">
                <td>设备损坏</td>
            </c:if>
        </tr>

        <tr>
            <td>租房日期：</td>
            <td><f:formatDate value="${room.rentDate}" pattern="yyyy-DD-mm"/> </td>
        </tr>
    </table>

    <table>
        <tr>
            <th>学生姓名</th>
            <th>所在班级</th>
            <th>联系电话</th>
        </tr>
        <c:if test="${room.studentBeanList==null}">
            <tr>
                <td colspan="3" style="text-align: center">暂无数据</td>
            </tr>
        </c:if>

        <c:if test="${room.studentBeanList!=null}">
            <c:forEach items="${room.studentBeanList}" var="stu">
            <tr>
                <td>${stu.studentName}</td>
                <td>${stu.myClass.className}</td>
                <td>${stu.studentPhone}</td>
            </tr>
            </c:forEach>

        </c:if>



    </table>

    <a href="${pageContext.request.contextPath}/room/index"><button>返回主菜单</button></a>
</div>

<!--页脚内容区域-->
<div id="footer">页脚</div>
</body>
</html>